<template>
	<div>
		<v-button theme="primary" size="small" @click=edit>编辑</v-button>
		<v-button theme="danger" size="small" @click=remove>删除</v-button>
	</div>
</template>

<script>
	
	export default {
		data: () => ({
			id: 0,
			name:"",
			model: {}
		}),
		methods: {
		    reload() {
					this.$dispatch("reload");
				},
			  edit() {
					this.$dispatch("edit");
				},
				remove() {
					let self = this;
					let data = {
						title: "删除操作",
						content: "您是否要删除机构" + self.name + "?"
					}
					Midway.confirm(data).then(function () {
						let _data = {
							brhId: self.id
						}
						self.$post({
							url: "/api/v1" + projectName_Url + "/sys/brh/del.html",
							data: _data
						}).then(function (response) {
							let message = {
								title:"操作提示",
								content:"删除机构"+self.name+"成功"
							}
							Midway.alert(message);
							self.reload();
						});
					})
				}
		}
	}
</script>